<?php 
   /*Classe temporário para criação das tabelas no banco*/
   Class criaTabela{
      function __construct(){} //método construtor
      
      #Tabela pessoa
      function pessoa(){
         $query = "CREATE TABLE public.pessoa (
                     pk_pes serial NOT NULL,
                     \"nomePes\" varchar(50) NOT NULL,
                     \"telPes\" varchar(13),
                     \"emailPes\" varchar(70),
                     \"docIdPes\" varchar(20),
                     CONSTRAINT pessoa_pkey PRIMARY KEY (pk_pes) 
                  )WITH (OIDS=FALSE);";
         return $query;
      }
      
      #Tabela professor
      function professor(){
      	$query = "CREATE TABLE professor (
                           \"matriculaUfmgPro\" int NOT NULL
                        )
      	INHERITS (pessoa)
      	WITH (OIDS=FALSE);";
      	return $query;
      }
      
      #Tabela espaco
      function espaco(){
      $query = "CREATE TABLE espaco (
            pk_esp serial NOT NULL,
            \"nomeEsp\" varchar(10) NOT NULL,
            \"localEsp\" varchar(10) NOT NULL,
            \"blocoEsp\" varchar(1) NOT NULL,
            \"andarEsp\" varchar(2) NOT NULL,
            \"qtdTomada110vEsp\" int,
            \"qtdTomada220vEsp\" int,
            \"qtdPontoDeRedeEsp\" int,
            \"tipoVentilacaoEsp\" varchar(15),
            \"qtdPortaEsp\" int,
            \"qtdJanelaEsp\" int,
            \"capacidadePessoasEsp\" int,
            CONSTRAINT espaco_pkey PRIMARY KEY (pk_esp)
            )
            WITH (OIDS=FALSE);";
      }
      
      #Tabela salaDeAula
      function saladeaula(){
      	$query = "CREATE TABLE \"salaDeAula\" (
            pk_sda serial NOT NULL,
            \"qtdTelaInterativaSdA\" int NOT NULL,
      	    \"qtdTelevisorSdA\" int NOT NULL,
      	    \"qtdQuadroBrancoSdA\" int NOT NULL,
      	    \"qtdProjetorSdA\" int NOT NULL,
      	    \"qtdAssentoParaCanhotoSdA\" int NOT NULL,     
      	    \"qtdAssentoParaObesoSdA\" int NOT NULL,     
            )
      	    INHERITS (espaco)     
            WITH (OIDS=FALSE);";
      }
   }
?>